#!/bin/sh
echo Setting up samba symlinks so webinterface config works
[ -e %OPTWARE_TARGET_PREFIX%/sbin/smbd ] && ln -sf %OPTWARE_TARGET_PREFIX%/sbin/smbd /usr/syno/sbin/smbd
[ -e %OPTWARE_TARGET_PREFIX%/sbin/nmbd ] && ln -sf %OPTWARE_TARGET_PREFIX%/sbin/nmbd /usr/syno/sbin/nmbd
[ ! -d %OPTWARE_TARGET_PREFIX%/etc/samba ] && mkdir -p %OPTWARE_TARGET_PREFIX%/etc/samba
[ ! -d %OPTWARE_TARGET_PREFIX%/etc/private ] && mkdir -p %OPTWARE_TARGET_PREFIX%/etc/private
ln -sf /writeable/configs/usr/syno/etc/smb.conf %OPTWARE_TARGET_PREFIX%/etc/samba/
ln -sf /writeable/configs/usr/syno/etc/private/secrets.tdb %OPTWARE_TARGET_PREFIX%/etc/samba/
ln -sf /writeable/configs/usr/syno/etc/private/smbpasswd %OPTWARE_TARGET_PREFIX%/etc/samba/
echo done
